/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.nc.kyiv.yellow.sociallibrary.constants;

import com.nc.kyiv.yellow.sociallibrary.dao.ConstantsDAO;
import java.util.Map;

/**
 *
 * @author My
 */
public class DataBaseConstants {

    private static Map<String, Integer> userStatus;
    private static Map<String, Integer> readStatus;
    private static Map<String, Integer> role;
    private static Map<String, Integer> moderStatus;
    private static Map<String, Integer> genre;
    private static final String USER_STATUS_TABLE_NAME = "user_status";
    private static final String USER_READ_TABLE_NAME = "read_status";
    private static final String ROLE_TABLE_NAME = "role";
    private static final String MODER_STATUS_TABLE_NAME = "moder_status";
    private static final String GENRE_TABLE_NAME = "genre";

    
    private DataBaseConstants(){
    }

    static {
        System.out.println("Loading constants");
        ConstantsDAO dao = new ConstantsDAO();
        userStatus = dao.initialiseConstants(USER_STATUS_TABLE_NAME);
        readStatus = dao.initialiseConstants(USER_READ_TABLE_NAME);
        role = dao.initialiseConstants(ROLE_TABLE_NAME);
        moderStatus = dao.initialiseConstants(MODER_STATUS_TABLE_NAME);
        genre = dao.initialiseConstants(GENRE_TABLE_NAME);
        System.out.println("Constants loaded");
    }

    public static Map<String, Integer> getUserStatus() {
        return userStatus;
    }

    public static Map<String, Integer> getReadStatus() {
        return readStatus;
    }

    public static Map<String, Integer> getRole() {
        return role;
    }

    public static Map<String, Integer> getModerStatus() {
        return moderStatus;
    }

    public static Map<String, Integer> getGenre() {
        return genre;
    }
    
}
